/**
 * Created with IntelliJ IDEA.
 * User: thkim
 * Date: 12. 7. 10
 * Time: 오후 11:43
 * To change this template use File | Settings | File Templates.
 */
public class BookIterator implements Iterator<Book> {
    @Override
    public boolean hasNext() {
        return bookShelf.getCount() > index;
    }

    @Override
    public Book next() {
        return bookShelf.getBook(index++);
    }

    private BookShelf bookShelf;

    public BookIterator(BookShelf bookShelf) {
        this.bookShelf = bookShelf;
    }

    private int index = 0;

}
